\(\int \cot ^3(e+f x) (b \csc (e+f x))^m \, dx\) [377]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 43 \[ \int \cot ^3(e+f x) (b \csc (e+f x))^m \, dx=\frac {(b \csc (e+f x))^m}{f m}-\frac {(b \csc (e+f x))^{2+m}}{b^2 f (2+m)} \]

[Out]

(b*csc(f*x+e))^m/f/m-(b*csc(f*x+e))^(2+m)/b^2/f/(2+m)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {2686, 14} \[ \int \cot ^3(e+f x) (b \csc (e+f x))^m \, dx=\frac {(b \csc (e+f x))^m}{f m}-\frac {(b \csc (e+f x))^{m+2}}{b^2 f (m+2)} \]

[In]

Int[Cot[e + f*x]^3*(b*Csc[e + f*x])^m,x]

[Out]

(b*Csc[e + f*x])^m/(f*m) - (b*Csc[e + f*x])^(2 + m)/(b^2*f*(2 + m))

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rubi steps \begin{align*} \text {integral}& = -\frac {b \text {Subst}\left (\int (b x)^{-1+m} \left (-1+x^2\right ) \, dx,x,\csc (e+f x)\right )}{f} \\ & = -\frac {b \text {Subst}\left (\int \left (-(b x)^{-1+m}+\frac {(b x)^{1+m}}{b^2}\right ) \, dx,x,\csc (e+f x)\right )}{f} \\ & = \frac {(b \csc (e+f x))^m}{f m}-\frac {(b \csc (e+f x))^{2+m}}{b^2 f (2+m)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.84 \[ \int \cot ^3(e+f x) (b \csc (e+f x))^m \, dx=\frac {(b \csc (e+f x))^m \left (2+m-m \csc ^2(e+f x)\right )}{f m (2+m)} \]

[In]

Integrate[Cot[e + f*x]^3*(b*Csc[e + f*x])^m,x]

[Out]

((b*Csc[e + f*x])^m*(2 + m - m*Csc[e + f*x]^2))/(f*m*(2 + m))

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 1.16 (sec) , antiderivative size = 3514, normalized size of antiderivative = 81.72

method result size
risch \(\text {Expression too large to display}\) \(3514\)

[In]

int(cot(f*x+e)^3*(b*csc(f*x+e))^m,x,method=_RETURNVERBOSE)

[Out]

1/(2+m)/f/(exp(2*I*(f*x+e))-1)^2/m*b^m*exp(I*(f*x+e))^m*(exp(2*I*(f*x+e))-1)^(-m)*2^m*(m*exp(1/2*I*csgn(b/(exp
(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^3*Pi*m)*exp(1/2*I*csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*Pi*csgn(I*b/(
exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*m)*exp(-1/2*I*Pi*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^3*m)*exp(1/
2*I*Pi*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*csgn(I*b)*m)*exp(1/2*I*Pi*csgn(I*b/(exp(2*I*(f*x+e))-1)
*exp(I*(f*x+e)))^2*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))*m)*exp(-1/2*I*Pi*csgn(I*b/(exp(2*I*(f*x+e))-1)*
exp(I*(f*x+e)))*csgn(I*b)*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))*m)*exp(1/2*I*Pi*csgn(I/(exp(2*I*(f*x+e))
-1))*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^2*m)*exp(-1/2*I*Pi*csgn(I/(exp(2*I*(f*x+e))-1))*csgn(I*exp(I*
(f*x+e))/(exp(2*I*(f*x+e))-1))*csgn(I*exp(I*(f*x+e)))*m)*exp(-1/2*I*Pi*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))
-1))^3*m)*exp(1/2*I*Pi*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^2*csgn(I*exp(I*(f*x+e)))*m)*exp(-1/2*I*csgn
(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*Pi*m)*exp(-1/2*I*csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*Pi*csgn
(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*m)*exp(1/2*I*Pi*m)*exp(4*I*e)*exp(4*I*f*x)+2*exp(1/2*I*csgn(b/(exp(2
*I*(f*x+e))-1)*exp(I*(f*x+e)))^3*Pi*m)*exp(1/2*I*csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*Pi*csgn(I*b/(ex
p(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*m)*exp(-1/2*I*Pi*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^3*m)*exp(1/2*
I*Pi*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*csgn(I*b)*m)*exp(1/2*I*Pi*csgn(I*b/(exp(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e
xp(I*(f*x+e)))^2*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))*m)*exp(-1/2*I*Pi*csgn(I*b/(exp(2*I*(f*x+e))-1)*ex
p(I*(f*x+e)))*csgn(I*b)*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))*m)*exp(1/2*I*Pi*csgn(I/(exp(2*I*(f*x+e))-1
))*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^2*m)*exp(-1/2*I*Pi*csgn(I/(exp(2*I*(f*x+e))-1))*csgn(I*exp(I*(f
*x+e))/(exp(2*I*(f*x+e))-1))*csgn(I*exp(I*(f*x+e)))*m)*exp(-1/2*I*Pi*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1
))^3*m)*exp(1/2*I*Pi*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^2*csgn(I*exp(I*(f*x+e)))*m)*exp(-1/2*I*csgn(b
/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*Pi*m)*exp(-1/2*I*csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*Pi*csgn(I
*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*m)*exp(1/2*I*Pi*m)*exp(2*I*f*x)*exp(2*I*e)-4*exp(1/2*I*csgn(b/(exp(2*I
*(f*x+e))-1)*exp(I*(f*x+e)))^3*Pi*m)*exp(1/2*I*csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*Pi*csgn(I*b/(exp(
2*I*(f*x+e))-1)*exp(I*(f*x+e)))*m)*exp(-1/2*I*Pi*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^3*m)*exp(1/2*I*
Pi*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*csgn(I*b)*m)*exp(1/2*I*Pi*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp
(I*(f*x+e)))^2*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))*m)*exp(-1/2*I*Pi*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(
I*(f*x+e)))*csgn(I*b)*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))*m)*exp(1/2*I*Pi*csgn(I/(exp(2*I*(f*x+e))-1))
*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^2*m)*exp(-1/2*I*Pi*csgn(I/(exp(2*I*(f*x+e))-1))*csgn(I*exp(I*(f*x
+e))/(exp(2*I*(f*x+e))-1))*csgn(I*exp(I*(f*x+e)))*m)*exp(-1/2*I*Pi*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))
^3*m)*exp(1/2*I*Pi*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^2*csgn(I*exp(I*(f*x+e)))*m)*exp(-1/2*I*csgn(b/(
exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*Pi*m)*exp(-1/2*I*csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*Pi*csgn(I*b
/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*m)*exp(1/2*I*Pi*m)*exp(2*I*f*x)*exp(2*I*e)+m*exp(1/2*I*Pi*m*(csgn(b/(exp
(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^3+csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*csgn(I*b/(exp(2*I*(f*x+e))-1)
*exp(I*(f*x+e)))-csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^3+csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))
^2*csgn(I*b)+csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))-csgn(
I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*csgn(I*b)*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))+csgn(I/(exp(2*I
*(f*x+e))-1))*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^2-csgn(I/(exp(2*I*(f*x+e))-1))*csgn(I*exp(I*(f*x+e))
/(exp(2*I*(f*x+e))-1))*csgn(I*exp(I*(f*x+e)))-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^3+csgn(I*exp(I*(f*x+
e))/(exp(2*I*(f*x+e))-1))^2*csgn(I*exp(I*(f*x+e)))-csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2-csgn(b/(exp(2
*I*(f*x+e))-1)*exp(I*(f*x+e)))*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))+1))+2*exp(1/2*I*Pi*m*(csgn(b/(exp
(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^3+csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*csgn(I*b/(exp(2*I*(f*x+e))-1)
*exp(I*(f*x+e)))-csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^3+csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))
^2*csgn(I*b)+csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))-csgn(
I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*csgn(I*b)*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))+csgn(I/(exp(2*I
*(f*x+e))-1))*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^2-csgn(I/(exp(2*I*(f*x+e))-1))*csgn(I*exp(I*(f*x+e))
/(exp(2*I*(f*x+e))-1))*csgn(I*exp(I*(f*x+e)))-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^3+csgn(I*exp(I*(f*x+
e))/(exp(2*I*(f*x+e))-1))^2*csgn(I*exp(I*(f*x+e)))-csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2-csgn(b/(exp(2
*I*(f*x+e))-1)*exp(I*(f*x+e)))*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))+1)))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.40 \[ \int \cot ^3(e+f x) (b \csc (e+f x))^m \, dx=-\frac {{\left ({\left (m + 2\right )} \cos \left (f x + e\right )^{2} - 2\right )} \left (\frac {b}{\sin \left (f x + e\right )}\right )^{m}}{f m^{2} - {\left (f m^{2} + 2 \, f m\right )} \cos \left (f x + e\right )^{2} + 2 \, f m} \]

[In]

integrate(cot(f*x+e)^3*(b*csc(f*x+e))^m,x, algorithm="fricas")

[Out]

-((m + 2)*cos(f*x + e)^2 - 2)*(b/sin(f*x + e))^m/(f*m^2 - (f*m^2 + 2*f*m)*cos(f*x + e)^2 + 2*f*m)

Sympy [F]

\[ \int \cot ^3(e+f x) (b \csc (e+f x))^m \, dx=\begin {cases} x \left (b \csc {\left (e \right )}\right )^{m} \cot ^{3}{\left (e \right )} & \text {for}\: f = 0 \\\frac {\int \frac {\cot ^{3}{\left (e + f x \right )}}{\csc ^{2}{\left (e + f x \right )}}\, dx}{b^{2}} & \text {for}\: m = -2 \\\frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - \frac {\log {\left (\tan {\left (e + f x \right )} \right )}}{f} - \frac {1}{2 f \tan ^{2}{\left (e + f x \right )}} & \text {for}\: m = 0 \\- \frac {m \left (b \csc {\left (e + f x \right )}\right )^{m} \cot ^{2}{\left (e + f x \right )}}{f m^{2} + 2 f m} + \frac {2 \left (b \csc {\left (e + f x \right )}\right )^{m}}{f m^{2} + 2 f m} & \text {otherwise} \end {cases} \]

[In]

integrate(cot(f*x+e)**3*(b*csc(f*x+e))**m,x)

[Out]

Piecewise((x*(b*csc(e))**m*cot(e)**3, Eq(f, 0)), (Integral(cot(e + f*x)**3/csc(e + f*x)**2, x)/b**2, Eq(m, -2)
), (log(tan(e + f*x)**2 + 1)/(2*f) - log(tan(e + f*x))/f - 1/(2*f*tan(e + f*x)**2), Eq(m, 0)), (-m*(b*csc(e +
f*x))**m*cot(e + f*x)**2/(f*m**2 + 2*f*m) + 2*(b*csc(e + f*x))**m/(f*m**2 + 2*f*m), True))

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.16 \[ \int \cot ^3(e+f x) (b \csc (e+f x))^m \, dx=\frac {\frac {b^{m} \sin \left (f x + e\right )^{-m}}{m} - \frac {b^{m} \sin \left (f x + e\right )^{-m}}{{\left (m + 2\right )} \sin \left (f x + e\right )^{2}}}{f} \]

[In]

integrate(cot(f*x+e)^3*(b*csc(f*x+e))^m,x, algorithm="maxima")

[Out]

(b^m*sin(f*x + e)^(-m)/m - b^m*sin(f*x + e)^(-m)/((m + 2)*sin(f*x + e)^2))/f

Giac [F]

\[ \int \cot ^3(e+f x) (b \csc (e+f x))^m \, dx=\int { \left (b \csc \left (f x + e\right )\right )^{m} \cot \left (f x + e\right )^{3} \,d x } \]

[In]

integrate(cot(f*x+e)^3*(b*csc(f*x+e))^m,x, algorithm="giac")

[Out]

integrate((b*csc(f*x + e))^m*cot(f*x + e)^3, x)

Mupad [B] (verification not implemented)

Time = 4.15 (sec) , antiderivative size = 92, normalized size of antiderivative = 2.14 \[ \int \cot ^3(e+f x) (b \csc (e+f x))^m \, dx=\frac {{\left (\frac {b}{\sin \left (e+f\,x\right )}\right )}^m\,\left (m+4\,{\sin \left (2\,e+2\,f\,x\right )}^2+m\,\left (2\,{\sin \left (2\,e+2\,f\,x\right )}^2-1\right )-16\,{\sin \left (e+f\,x\right )}^2\right )}{f\,m\,\left (2\,{\sin \left (2\,e+2\,f\,x\right )}^2-8\,{\sin \left (e+f\,x\right )}^2\right )\,\left (m+2\right )} \]

[In]

int(cot(e + f*x)^3*(b/sin(e + f*x))^m,x)

[Out]

((b/sin(e + f*x))^m*(m + 4*sin(2*e + 2*f*x)^2 + m*(2*sin(2*e + 2*f*x)^2 - 1) - 16*sin(e + f*x)^2))/(f*m*(2*sin
(2*e + 2*f*x)^2 - 8*sin(e + f*x)^2)*(m + 2))